# -*- coding: utf-8 -*-

'''eof
name:黑名单效验
code:Blacklist_Check
tableName:
columnName:
groups:准入>企业业务信息校验
dependencies:WDXT_AmlBlack,WDXT_Black
type:常用指标
datasourceType:在线指标
description:黑名单效验
eof'''

import sys

reload(sys)
sys.setdefaultencoding('utf-8')




def blacklist_check():
	FXQ_Blacklist_status = WDXT_AmlBlack['sysHead']
	Blaclist_status = WDXT_Black['sysHead']
	FXQ_Blacklist=WDXT_AmlBlack['body']
	Blacklist=WDXT_Black['body']
	#黑名单数据
	Blacklist_data=Blacklist.get('BLACKLISTDATAS')
	FXQ_Blacklist_data=FXQ_Blacklist.get('AMLBLACKLISTDATAS')
	#如果responseCode==99，则说明该表返回失败
	if FXQ_Blacklist_status.get('responseCode') =="99" and Blaclist_status.get('responseCode') =="99":
		return u"缺失值"
	else:
		if len(Blacklist_data)+len(FXQ_Blacklist_data) >1:
			return 1
		else:
			return 0


result = blacklist_check()
